<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <style type="text/css">
    </style>
</head>
<body>
</body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript" src="./script/common/common.js"></script>
<script type="text/javascript">
    var UIEaseChat;
    apiready = function () {
        if ($api.getStorage('version') == undefined) {
            $api.setStorage('version', 0);
        }

        openMain();

        // api.openWin({
        //     name: 'test',
        //     // url: './html/login/login_win.html',
        //     // url: './html/login/registerFrame.html',
        //     // url: './html/login/setPasswordFrame.html',
        //     // url: './html/main.html',
        //     // url: './html/tool/addMemberWin.html',
        //     // url: './html/tool/babyNameWin.html',
        //     // url: './html/tool/fortuneTellingWin.html',
        //     url: './html/my/memberWin.html',
        //     slidBackEnabled: false,
        //     animation: {
        //         type: 'none',
        //         duration: 0
        //     }
        // });

        // imHuanxin();
    }

    //打开主页或登录页
    function openMain() {
        if($api.getStorage('token')) {
            //有token打开主页
            api.openWin({
                name: 'main',
                url: './html/main.html',
                slidBackEnabled: false,
                animation: {
                    type: 'none',
                    duration: 0
                }
            });
        } else {
            //没有token打开登录页
            api.openWin({
                name: 'loginPage',
                url: './html/login/login_win.html',
                slidBackEnabled: false,
                animation: {
                    type: 'none',
                    duration: 0
                }
            });
        }
    }

</script>
</html>
